package com.jikexueyuan.getcontact;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.database.Cursor;
import android.provider.ContactsContract.CommonDataKinds.Phone;

public class GetNumber {

	public static List<MyContact> lists = new ArrayList<MyContact>();
	
	public static String getNumber(Context context) {
		Cursor cursor = context.getContentResolver().
				query(Phone.CONTENT_URI, null, null, null, null);
		String name;
		String number;
		while (cursor.moveToNext()) {
			name = cursor.getString(cursor.getColumnIndex(Phone.DISPLAY_NAME));
			number = cursor.getString(cursor.getColumnIndex(Phone.NUMBER));
			MyContact myContact = new MyContact(name, number);
			lists.add(myContact);
		}
		return null;
	}

}
